/*
package com.buer.storage.common.plugin.websocket;


import com.alibaba.fastjson.JSON;
import com.buer.storage.common.eumn.ResultEnum;
import com.buer.storage.common.utils.BaseResult;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.socket.TextMessage;
import org.springframework.web.socket.WebSocketSession;

import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;


@Controller
public class WSTest {

	@ResponseBody
	@RequestMapping("/ws/send")
	public BaseResult sendMsg() throws IOException {
		//建立连接
		ThmsWebSocketHandler swsh = ThmsWebSocketHandler.getSystemWebSocketHandler();
		//发送的消息
		//ThmsWebSocketMessage twsm  = new ThmsWebSocketMessage("1", "1010111", "zszd", new Object());
		List<WebSocketSession> webSocketSessions = ThmsWebSocketUserMap.getWebSocketSessions("3");
		//发送
		//swsh.sendMessageToUser(twsm);
		Map map=new HashMap();
		map.put("type",1);
		map.put("data","1111");
		for (WebSocketSession webSocketSession:webSocketSessions){
			webSocketSession.sendMessage(new TextMessage(JSON.toJSONString(map)));
		}
		return BaseResult.build(ResultEnum.SUCCESS);
	}
}
*/
